<div class="col-lg-12">
  <h1 style="font-family:Junction Light;"><%= translation('user_tag.index.popular_user_tags') %></h1>

  <% cache('feature_user_tags-header', skip_digest: true) do %>
    <%= feature('user-tags-header') %>
  <% end %>

  <p><%= translation('user_tag.index.browse_popular_user_tags') %></p>

  <input class="form-control" type="text" id="myInput"  placeholder="Search for user tags..">
  <script>
    $('#myInput').keypress(function (e) {
      var key = e.which;
      if (key == 13) { // enter key
        var pre = document.getElementById("myInput").value;
        window.location.href = "<%= user_tags_path %>"+"/" + pre
      }
    });
  </script>
  <br/><br/>

  <table class="table">
    <tr>
      <th><a href = "<%= user_tags_path %>?sort=value"><%= translation('user_tag.index.user_tag') %></a> <i class="fa fa-arrows-v"></i></th>
      <th><a href = "<%= user_tags_path %>?sort=uses"><%= translation('user_tag.index.number_of_uses') %></a> <i class="fa fa-arrows-v"></i></th>
    </tr>
    <% @user_tags.each do |user_tag| %>
      <tr>
        <td><i class="fa fa-tag"></i> <a href="/user_tag/<%= user_tag[0] %>"><%= user_tag[0] %></a></td>
        <td><%= user_tag[1] %></td>
      </tr>
    <% end %>
  </table>
<% if @pagy %> <%= raw pagy_bootstrap_nav @pagy %> <% else %> <%= will_paginate @user_tags, renderer: WillPaginate::ActionView::BootstrapLinkRenderer %> <% end %>

  <hr />

</div>
